/**
 * 作者:李杰
 * email: maillijie@gmail.com
 */
package com.javainfo.dao;

import java.util.List;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;

import com.javainfo.dao.inf.UserDaoIf;
import com.javainfo.entity.User;

public class UserDao extends BaseDao<User> implements UserDaoIf{

	@SuppressWarnings("unchecked")
	public List<User> getUserListByAccountStart(String start) {
		DetachedCriteria criteria = DetachedCriteria.forClass(User.class);
		criteria.add(Restrictions.like("userAccount", start + "%"));
		List<User> userList = (List<User>) getHibernateTemplate()
				.findByCriteria(criteria);
		return userList;
	}
}
